<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8">
    <title>悦定内容管理系统</title>

    <!--判断是否登陆-->
    <script type="text/javascript" src="../../vendor/jquery-2.0.3.min.js"></script>
    <script type="text/javascript" src="../../js/config.js"></script>
    <script type="text/javascript" src="../../js/jquerySession.js"></script>
    <script type="text/javascript">
        if ($.session.get('token') == null) {
            alert("用户未登录！");
            window.location.href = "../../login.html"
        }
    </script>

    <link href="../../css/common.css" rel="stylesheet">
    <link href="../../css/layout.css" rel="stylesheet">
    <link href="../../css/style_fy.css" rel="stylesheet">
    <style>
        .explain-col {
            border: 1px solid #ffbe7a;
            zoom: 1;
            padding: 8px 10px;
            line-height: 20px;
        }
    </style>

    <link rel="stylesheet" href="../../css/layer.css" id="layui_layer_skinlayercss">
</head>

<body>
<div class="wrap">
    <!--header-->
    <div class="header">
        <div class="logo"></div>
        <h1 class="logo"><a href="#" title="内容管理"><img src="../../images/logo.png" title="内容管理" alt="心跳-内容管理"></a></h1>
        <div class="menu">
            <ul>

                <li class="">
                    <a href="../user/participant.html">用户</a>
                </li>
                <li class="">
                    <a href="../app/welcome.html">APP</a>
                </li>
                <li class="current">
                    <a href="../match/matches.html">比赛</a>
                </li>
                <li class="">
                    <a href="../finance/ordermanagement_list.html">财务</a>
                </li>
                <li class="">
                    <a href="../message/sendLog.html">短信</a>
                </li>
                <li class="">
                    <a href="../statistics/registeredUsers.html">统计</a>
                </li>

            </ul>
        </div>
        <div class="user">
            <!--导航条-->
            <ul class="user-main">
                <li id="li-1"><img src="../../images/noavator.png" class="herad-img">admin ( admin )<span></span></li>
            </ul>
            <!--隐藏盒子-->
            <div id="box-1" class="hidden-box hidden-loc-index">
                <ul>
                    <li><a href="#">基本信息</a></li>
                    <li>
                        <a href="matches.html#" data-href="#" class="edit">修改密码</a>
                    </li>
                    <li>
                        <a href="../../logout.html">安全退出</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <!-- 左则栏-->
    <div class="sidebar-content">
        <ul id="accordion" class="accordion">
            <li class="open">
                <div class="link">
                    <img src="../../images/1.png"><i class="fa"></i>比赛信息管理<i class="fa fa-chevron-down"></i>
                </div>
                <ul class="submenu" style="display: block">
                    <li><img src="../../images/4.png">
                        <a href="matches.html">比赛列表</a>
                    </li>
                </ul>
            </li>
            <li class="open">
                <div class="link">
                    <img src="../../images/1.png"><i class="fa"></i>路线管理<i class="fa fa-chevron-down"></i>
                </div>
                <ul class="submenu" style="display: block">
                    <li><img src="../../images/4.png">
                        <a href="routes.html">路线列表</a>
                    </li>
                    <li><img src="../../images/4.png">
                        <a href="route_rule.html">路线规则</a>
                    </li>
                </ul>
            </li>
            <li class="open">
                <div class="link">
                    <img src="../../images/1.png"><i class="fa"></i>点标管理<i class="fa fa-chevron-down"></i>
                </div>
                <ul class="submenu" style="display: block">
                    <li><img src="../../images/4.png">
                        <a href="points.html">点标列表</a>
                    </li>
                </ul>
            </li>
            <li class="open">
                <div class="link">
                    <img src="../../images/1.png"><i class="fa"></i>任务管理<i class="fa fa-chevron-down"></i>
                </div>
                <ul class="submenu" style="display: block">
                    <li><img src="../../images/4.png">
                        <a href="mission.html">任务列表</a>
                    </li>
                </ul>
            </li>
            <li class="open">
                <div class="link">
                    <img src="../../images/1.png"><i class="fa"></i>队伍管理<i class="fa fa-chevron-down"></i>
                </div>
                <ul class="submenu" style="display: block">
                    <li><img src="../../images/4.png">
                        <a href="teams.html">队伍列表</a>
                    </li>
                </ul>
            </li>
            <li class="open">
                <div class="link">
                    <img src="../../images/1.png"><i class="fa"></i>过程管理管理<i class="fa fa-chevron-down"></i>
                </div>
                <ul class="submenu" style="display: block">
                    <li><img src="../../images/4.png">
                        <a href="procedure.html">过程管理</a>
                    </li>
                </ul>
            </li>
            <li class="open">
                <div class="link">
                    <img src="../../images/1.png"><i class="fa"></i>成绩管理<i class="fa fa-chevron-down"></i>
                </div>
                <ul class="submenu" style="display: block">
                    <li><img src="../../images/4.png">
                        <a href="achievement.html">成绩管理</a>
                    </li>
                </ul>
            </li>
            <li class="open">
                <div class="link">
                    <img src="../../images/1.png"><i class="fa"></i>作品管理<i class="fa fa-chevron-down"></i>
                </div>
                <ul class="submenu" style="display: block">
                    <li><img src="../../images/4.png">
                        <a href="product.html">作品管理</a>
                    </li>
                </ul>
            </li>
        </ul>
    </div>
    <!--右侧 start-->
    <div class="right-content m_l_250">
        <div id="top-alert" class="fixed alert alert-error" style="display: none;">
            <button class="close fixed" style="margin-top: 4px;">&times;</button>
            <div class="alert-content">这是内容</div>
        </div>

        <div class="right-warp">
            <div class="content-title">
                <h1>比赛列表</h1></div>
            <div class="content-nav">
                <div class="content-btn">
                    <a href="javascript:void(0)" onclick="exportProductExcel()" class="btn ml17 btn-primary" id="export">导出Excel</a>
                </div>
                <!--搜索条件-->
                <div class="content-btn" style="float:right">
                    <form name="searchform" action="" method="get">
                        <table width="100%" cellspacing="0" class="search-form">
                            <tbody>
                            <tr>
                                <td>
                                    <div class="explain-col">
                                        比赛名称：
                                        <select name="cateid" id="matches">
                                        </select>
                                        路线名称：
                                        <select name="cateid" id="routes">
                                        </select>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </form>
                </div>
            </div>

            <!--表单开始-->
            <form name="myform" id="myform">
                <table id="mytable" cellspacing="0" class="list-table">
                    <thead>
                    <tr>
                        <th>院系</th>
                        <th>专业</th>
                        <th>年级</th>
                        <th>团队</th>
                        <th>作品名称</th>
                        <th>提交时间</th>
                        <th>作品下载</th>
                    </tr>
                    </thead>
                    <tbody id="product_list">


                    </tbody>
                </table>
            </form>
            <!--表单结束-->
            <div class="fy_box" id="pageGro">
                <div>
                    <a class="first" href="javascript:void(0)" onclick="GoToFirstPage()">
                        <span class="current">首页</span>
                    </a>
                    <a class="prev" href="javascript:void(0)" onclick="GoToPrePage()">上一页</a>
                    <a class="next" href="javascript:void(0)" onclick="GoToNextPage()">下一页</a>
                    <a class="num">
                        <input type="number" name="num"/>
                    </a>
                    <a class="run" href="javascript:void(0)" onclick="GoToAppointPage()">跳转</a>
                    <a class="last" href="javascript:void(0)" onclick="GoToEndPage()">尾页</a>
                    <a class="currentPage" href="javascript:void(0)"></a>
                    <a class="total" href="javascript:void(0)"></a>
                </div>
            </div>
        </div>
    </div>
    <!--右侧 end-->
</div>
<script type="text/javascript" src="../../vendor/layer.js"></script>
<script type="text/javascript" src="product.js"></script>
<script type="text/javascript" src="../../js/common.js"></script>
<script type="text/javascript" src="../../js/index.js"></script>
<script type="text/javascript">
    $(function () {
        $("#so_option").hover(function () {
            $(".soTypeList").show();
        });

        $("#so_option").hover(function () {
            $(".soTypeList").show();
        }, function () {
            $(".soTypeList").hide();
        });

        $(".soTypeList li").click(function () {
            $("#so_type").html($(this).html());
            $(".soTypeList").hide();
        });
        /* 左边菜单高亮 */
        var $subnav = $("#accordion"),
                url;
        url = window.location.pathname + window.location.search;
        url = url.replace(/(\/(p)\/\d+)|(&p=\d+)|(\/(id)\/\d+)|(&id=\d+)|(\/(group)\/\d+)|(&group=\d+)/, "");
        $subnav.find("a[href='" + url + "']").parent().addClass("current");

    });
</script>

<!-- 通用方法 -->
<script>
    //
    function confirm_submitAll(url, msg) {
        layer.confirm(msg, {
            btn: ['确定', '取消'] //按钮
        }, function () {
            submitForm(url, $('#myform'));
        }, function () {

        });
    }

    function confirm_deleteAll(url) {
        layer.confirm('你确认删除吗？', {
            btn: ['确定', '取消'] //按钮
        }, function () {
            submitForm(url, $('#myform'));
        }, function () {

        });
    }

    //ajax提交表单
    function submitForm(url, form) {
        $.post(url, form.serialize(), function (data) {
            if (data.status != -1 && data.status != 0) {
                layer.alert(data.msg, {
                    icon: 1,
                    time: 2000,
                    end: function () {
                        window.location.reload();
                    }
                });
            } else if (data.status == -1) {
                layer.alert(data.msg, {
                    icon: 2,
                    time: 2000,
                    end: function () {
                        window.location.reload();
                    }
                });
            } else if (data.status == 0) {
                layer.alert(data['info'], {
                    icon: 2,
                    time: 2000,
                    end: function () {
                        window.location.reload();
                    }
                });
            }
        });

    }
    //询问并进行某个操作
    function confirmurl(id, msg) {
        alert(id);
        layer.confirm(msg, {
            btn: ['确定', '取消'] //按钮
        }, function () {
            $.ajax({
                type: "GET",
                url: baseUrl + "/matches/" + id + "/delete",
                success: function (json) {
                    if (json.meta.code == "200") {
                        alert("删除成功");
                        $("#" + id + "").remove();
                        layer.closeAll();
                    }
                },
                error: function () {
                    alert("删除失败");
                    layer.closeAll();
                }
            });
        }, function () {
            layer.closeAll();
        });
    }

    //修改的iframe
//    function edit(url, name, area) {
//        if (area == 'undefined' || area == undefined)
//            area = ['893px', '600px'];
//        layer.open({
//            type: 2,
//            title: '修改--' + name,
//            shadeClose: false,
//            shade: 0.4,
//            maxmin: false, //开启最大化最小化按钮
//            area: area,
//            content: url,
//            btn: ['确定', '取消'],
//            yes: function (index, layero) { //或者使用btn1
//                var id = url.substring(url.indexOf("=") + 1);
//                var body = layer.getChildFrame('body', index);
//                var matchTitle = body.find("#matchName").val();
//                var matchPlace = body.find("#matchPlace").val();
//                var matchSponsor = body.find("#sponsor").val();
//                var matchPhone = body.find("#phone").val();
//                var price = body.find('#price').val();
//                var enrollStart = body.find("#enroll_startDate").val();
//                var enrollEnd = body.find("#enroll_endDate").val();
//                var matchStart = body.find("#match_startDate").val();
//                var matchEnd = body.find("#match_endDate").val();
//                var matchContent = body.find('#editor_id').val();
//                var file = body.find('#file').val();
//                if (file != null) {
//                    var formData = new FormData();
//                    formData.append('file', body.find('#file')[0].files[0]);
//                    formData.append('name', matchTitle);
//                    formData.append('matchPlace', matchPlace);
//                    formData.append('sponsor', matchSponsor);
//                    formData.append('phoneNumber', matchPhone);
//                    formData.append('price', price);
//                    formData.append('enrollStart', enrollStart);
//                    formData.append('enrollEnd', enrollEnd);
//                    formData.append('matchStart', matchStart);
//                    formData.append('matchEnd', matchEnd);
//                    formData.append('introduction', matchContent);
//                    $.ajax({
//                        type: "POST",
//                        url: baseUrl + "/matches/" + id,
//                        data: formData,
//                        processData: false,
//                        contentType: false,
//                        success: function (json) {
//                            if (json.meta.code == "200") {
//                                alert("修改成功!");
//                                layer.close(index);
//                                window.location.reload();
//                            }
//                        },
//                        error: function (data) {
//                            alert("error:" + "修改失败!");
//                        }
//                    });
//                } else {
//                    $.ajax({
//                        type: "POST",
//                        url: baseUrl + "/matches/" + id,
//                        data: {
//                            name: matchTitle,
//                            matchPlace: matchPlace,
//                            sponsor: matchSponsor,
//                            phoneNumber: matchPhone,
//                            price: price,
//                            enrollStart: enrollStart,
//                            enrollEnd: enrollEnd,
//                            matchStart: matchStart,
//                            matchEnd: matchEnd,
//                            introduction: matchContent
//                        },
//                        processData: false,
//                        contentType: false,
//                        success: function (json) {
//                            if (json.meta.code == "200") {
//                                alert("修改成功!");
//                                layer.close(index);
//                                window.location.reload();
//                            }
//                        },
//                        error: function (data) {
//                            alert("error:" + "修改失败!");
//                        }
//                    });
//                }
//            },
//            cancel: function (index) { //或者使用btn2
//                layer.closeAll();
//            }
//        });
//    }

//    function details(url, name, area) {
//        if (area == 'undefined' || area == undefined)
//            area = ['893px', '600px'];
//        layer.open({
//            type: 2,
//            title: name,
//            shadeClose: true,
//            shade: 0.4,
//            maxmin: false, //开启最大化最小化按钮
//            area: area,
//            content: url,
//            btn: ['知道了']
//        });
//    }


//    //添加的弹出iframe
//    function add(uri, title, area) {
//        if (area == 'undefined' || area == undefined)
//            area = ['893px', '600px'];
//        layer.open({
//            type: 2,
//            title: title,
//            shadeClose: false,
//            shade: 0.4,
//            maxmin: false, //开启最大化最小化按钮
//            area: area,
//            content: uri,
//            btn: ['确定', '取消'],
//            yes: function (index, layero) { //或者使用btn1
//                var body = layer.getChildFrame('body', index);
//                var matchTitle = body.find("#matchName").val();
//                var matchPlace = body.find("#matchPlace").val();
//                var matchSponsor = body.find("#sponsor").val();
//                var matchPhone = body.find("#phone").val();
//                var price = body.find('#price').val();
//                var enrollStart = body.find("#enroll_startDate").val();
//                var enrollEnd = body.find("#enroll_endDate").val();
//                var matchStart = body.find("#match_startDate").val();
//                var matchEnd = body.find("#match_endDate").val();
//                var matchContent = body.find('#editor_id').val();
//                var formData = new FormData();
//                formData.append('file', body.find('#file')[0].files[0]);
//                formData.append('name', matchTitle);
//                formData.append('matchPlace', matchPlace);
//                formData.append('sponsor', matchSponsor);
//                formData.append('phoneNumber', matchPhone);
//                formData.append('price', price);
//                formData.append('enrollStart', enrollStart);
//                formData.append('enrollEnd', enrollEnd);
//                formData.append('matchStart', matchStart);
//                formData.append('matchEnd', matchEnd);
//                formData.append('introduction', matchContent);
//                $.ajax({
//                    type: "POST",
//                    url: baseUrl + "/matches",
//                    data: formData,
//                    processData: false,
//                    contentType: false,
//                    success: function (json) {
//                        if (json.meta.code == "200") {
//                            alert("添加成功！");
//                            layer.close(index);
//                            window.location.reload();
//                        }
//                    },
//                    error: function (data) {
//                        alert("error:" + "修改失败，可能未选择文件");
//                    }
//                });
//            },
//            cancel: function (index) { //或者使用btn2
//                layer.closeAll();
//            }
//        });
//    }
</script>

</body>

</html>